# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigtableAdmin.V2.Model.AppProfile do
  @moduledoc """
  A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application.

  ## Attributes

  *   `dataBoostIsolationReadOnly` (*type:* `GoogleApi.BigtableAdmin.V2.Model.DataBoostIsolationReadOnly.t`, *default:* `nil`) - Specifies that this app profile is intended for read-only usage via the Data Boost feature.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Long form description of the use case for this AppProfile.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Strongly validated etag for optimistic concurrency control. Preserve the value returned from `GetAppProfile` when calling `UpdateAppProfile` to fail the request if there has been a modification in the mean time. The `update_mask` of the request need not include `etag` for this protection to apply. See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more details.
  *   `multiClusterRoutingUseAny` (*type:* `GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny.t`, *default:* `nil`) - Use a multi-cluster routing policy.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The unique name of the app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/_a-zA-Z0-9*`.
  *   `priority` (*type:* `String.t`, *default:* `nil`) - This field has been deprecated in favor of `standard_isolation.priority`. If you set this field, `standard_isolation.priority` will be set instead. The priority of requests sent using this app profile.
  *   `singleClusterRouting` (*type:* `GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting.t`, *default:* `nil`) - Use a single-cluster routing policy.
  *   `standardIsolation` (*type:* `GoogleApi.BigtableAdmin.V2.Model.StandardIsolation.t`, *default:* `nil`) - The standard options used for isolating this app profile's traffic from other use cases.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataBoostIsolationReadOnly =>
            GoogleApi.BigtableAdmin.V2.Model.DataBoostIsolationReadOnly.t() | nil,
          :description => String.t() | nil,
          :etag => String.t() | nil,
          :multiClusterRoutingUseAny =>
            GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny.t() | nil,
          :name => String.t() | nil,
          :priority => String.t() | nil,
          :singleClusterRouting =>
            GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting.t() | nil,
          :standardIsolation => GoogleApi.BigtableAdmin.V2.Model.StandardIsolation.t() | nil
        }

  field(:dataBoostIsolationReadOnly,
    as: GoogleApi.BigtableAdmin.V2.Model.DataBoostIsolationReadOnly
  )

  field(:description)
  field(:etag)

  field(:multiClusterRoutingUseAny, as: GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny)

  field(:name)
  field(:priority)
  field(:singleClusterRouting, as: GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting)
  field(:standardIsolation, as: GoogleApi.BigtableAdmin.V2.Model.StandardIsolation)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.AppProfile do
  def decode(value, options) do
    GoogleApi.BigtableAdmin.V2.Model.AppProfile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.AppProfile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
